@extends('common.admin_template')

@section('content')
    <div class="boxWidth">
        @include('common.notice_msg')
        <div class="row searchLine">
            <form method="post" action="{{url('admin/shows/user/add')}}">
            <div class="col-xs-2 ">
                    <input type="hidden" name="_token" value="{{ csrf_token() }}">
                    <input type="hidden" name="id" value="{{ $LiveId }}">
                    <div id="searchInputBox"><input type="text" name="uid" class="form-control" placeholder="填写用户ID" id="searchInput"></div>
            </div>
            <div class="col-xs-2">
                <button class="btn btn-default searchBtn" id="formSubmit" type="submit">添加</button>
            </div>
            <div class="col-xs-8">
            </div>
            </form>
        </div>
        <table class="table table-hover adminTableBg">
            <thead>
            <tr>
                <th class="col-xs-3">用户ID</th>
                <th class="col-xs-3">用户名</th>
                <th class="col-xs-3">发言数量</th>
                <th class="col-xs-3">操作</th>
            </tr>
            </thead>
            <tbody>
            @foreach($Users as $u)
                <tr>
                    <th class="col-xs-3 itemTd">{{$u->user_id}}</th>
                    <th class="col-xs-3 itemTd">{{$u->name}}</th>
                    <th class="col-xs-3 itemTd">{{$u->count}}</th>
                    <th class="col-xs-3 itemTd">
                        <a href="{{url('admin/shows/user/del',['id' => $u->id])}}"><span class="redColor" id="delInput" onclick="if(!confirm('是否确认删除？'))return false">删除</span></a>
                    </th>
                </tr>
            @endforeach
            </tbody>
        </table>
        <div class="pull-right">
            {!! $Users->render() !!}
        </div>
    </div>
@stop
@section('js')
    <script>
        $('#formSubmit').on('click',function (e) {
            var str = $('#searchInput').val().replace(/(^\s*)|(\s*$)/g, "");
            if(!str){
                $('#searchInputBox').addClass('has-error');
                e.preventDefault();
            }
        })
    </script>
@stop